import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/Home.vue'
import One from '../components/one/one.vue'
import Wxrecharge from '../components/wxrecharge/wxrecharge.vue'
import Zfbrecharge from '../components/zfbrecharge/zfbrecharge.vue'
import History from '../components/history/history.vue'
import WithdrawDeposit from '../components/withdrawDeposit/withdrawDeposit.vue'
import Invite from '../components/invite/invite.vue'
import Spread from '../components/spread/spread.vue'
import Modification from '../components/modification/modification.vue'
import Yongjin from '../components/yongjin/yongjin.vue'
import Guess from '../components/guess.vue'
import Details from '../components/details.vue'
import Analyse from '../components/analyse.vue'
import Tuijianzc from '../components/tuijianzc.vue'

Vue.use(VueRouter)
const _push = VueRouter.prototype.push
VueRouter.prototype.push = function(location) {
return _push.call(this, location).catch(err => err)
}

const routes = [
    { path: '/', redirect: '/home' },
    {
        path: '/home',
        name: 'home',
        component: Home,
        redirect: '/one',
        children: [
            { path: '/one', name:'one', component: One },
            { path: '/wxrecharge', name:'wxrecharge', component: Wxrecharge },
            { path: '/zfbrecharge', name:'zfbrecharge', component: Zfbrecharge },
            { path: '/history', name:'history', component: History },
            { path: '/withdrawDeposit', name:'withdrawDeposit',  component: WithdrawDeposit },
            { path: '/invite', name:'invite', component: Invite },
            { path: '/spread', name:'spread', component: Spread },
            { path: '/modification', name:'modification', component: Modification },
            { path: '/yongjin', name:'yongjin', component: Yongjin },
            { path: '/guess', name:'guess', component: Guess },
            { path: '/details', name:'details', component: Details },
            { path: '/analyse', name:'analyse', component: Analyse }
        ]
    },
    { path: '/tuijianzc', name:'tuijianzc', component: Tuijianzc }
]

// const routes = [
//     {
//         path: '/',
//         component: Home,
//         redirect: '/one',
//         children: [
//             { path: 'one', name:'one', component: One },
//             { path: 'wxrecharge', component: Wxrecharge },
//             { path: 'zfbrecharge', component: Zfbrecharge },
//             { path: 'history', component: History },
//             { path: 'withdrawDeposit', component: WithdrawDeposit },
//             { path: 'invite', component: Invite },
//             { path: 'spread', component: Spread },
//             { path: 'modification', component: Modification }
//         ]
//     },
//     { path: '/guess', component: Guess },
//     { path: '/details', component: Details },
//     { path: '/analyse', component: Analyse }
// ]
const router = new VueRouter({
    routes
})


export default router
